import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class DegreeMapper extends Mapper<LongWritable, Text, Text, DegreeFlowBean> {
    Text k = new Text();
    DegreeFlowBean flowbean = new DegreeFlowBean();
    protected void map(LongWritable key,Text value, Mapper<LongWritable, Text, Text, DegreeFlowBean>.Context context) throws IOException, InterruptedException {

        String[] fields = value.toString().split("\t");

        flowbean.set(fields[3], fields[1], fields[4], Long.parseLong(fields[6]),fields[13]);
        k.set(fields[13]);


        context.write(k, flowbean);

    }
}